package com.loser007.quchuanw.utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class JsonConfig {
	public static String DIR = "./ACache/";

	public static String getAsString(String fileName) {
		File file = new File(DIR + fileName);
		if (!file.exists())
			return null;
		BufferedReader in = null;
		try {
			InputStreamReader read = new InputStreamReader(new FileInputStream(
					file), "UTF-8");// 考虑到编码格式
			in = new BufferedReader(read);
			String readString = "";
			CLog.e("----------");
			String currentLine;
			while ((currentLine = in.readLine()) != null) {
				readString += currentLine;
				CLog.e(currentLine);
			}
			return readString;
		} catch (IOException e) {
			e.printStackTrace();
			return null;
		} finally {
			if (in != null) {
				try {
					in.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}

		}

	}
}
